package com.supermap.originTest;


import com.supermap.data.*;


public class BatchPublishSWMU {


    static String genPath = "http://localhost:8090";
    /**
     * 程序入口点
     * The entrance of the programme.
     */
    public static void main(String[] args) {



        Workspace workspace = new Workspace();
        WorkspaceConnectionInfo conInfo = new WorkspaceConnectionInfo(
                "E:\\MapData\\bentleyData\\WorkSpace.smwu");
        conInfo.setType(WorkspaceType.SMWU);
        workspace.open(conInfo);
        Datasource datasource = workspace.getDatasources().get("DataSource");


        String mapXml = "<sml:Map>\n" +
                "<sml:Name>test@test</sml:Name>\n" +
                "<sml:Description/>\n" +
                "<sml:Version>20120328</sml:Version>\n" +
                "<sml:ColorMode>Default</sml:ColorMode>\n" +
                "<sml:LineSmoothingMode>TRUE</sml:LineSmoothingMode>\n" +
                "<sml:TextSmoothingMode>TRUE</sml:TextSmoothingMode>\n" +
                "<sml:ViewSettings>\n" +
                "<sml:DefaultScale>0.00000484120591</sml:DefaultScale>\n" +
                "<sml:CoordinateRatio>5389.205767240178</sml:CoordinateRatio>\n" +
                "<sml:DefaultCenter>\n" +
                "<sml:x>103.400705357000021</sml:x>\n" +
                "<sml:y>30.9541854275000219</sml:y>\n" +
                "</sml:DefaultCenter>\n" +
                "<sml:MarginWidthViewEntire>50</sml:MarginWidthViewEntire>\n" +
                "</sml:ViewSettings>\n" +
                "<sml:RotationSettings>\n" +
                "<sml:Angle>0</sml:Angle>\n" +
                "<sml:RotateMarker>TRUE</sml:RotateMarker>\n" +
                "<sml:RotateText>TRUE</sml:RotateText>\n" +
                "</sml:RotationSettings>\n" +
                "<sml:TextSettings>\n" +
                "<sml:FixedTextOrientation>FALSE</sml:FixedTextOrientation>\n" +
                "<sml:AllowTextOverlap>FALSE</sml:AllowTextOverlap>\n" +
                "<sml:IsDrawTextAtLast>TRUE</sml:IsDrawTextAtLast>\n" +
                "<sml:IsTextLayerReverse>TRUE</sml:IsTextLayerReverse>\n" +
                "<sml:MinVisibleTextSize>0.1</sml:MinVisibleTextSize>\n" +
                "<sml:MaxVisibleTextSize>1000</sml:MaxVisibleTextSize>\n" +
                "<sml:IsCompatibleFontHeight>TRUE</sml:IsCompatibleFontHeight>\n" +
                "</sml:TextSettings>\n" +
                "<sml:MapOverlapDisplayedOptions>\n" +
                "<sml:AllowTextOverlap>FALSE</sml:AllowTextOverlap>\n" +
                "<sml:AllowPointOverlap>TRUE</sml:AllowPointOverlap>\n" +
                "<sml:AllowTextAndPointOverlap>TRUE</sml:AllowTextAndPointOverlap>\n" +
                "<sml:AllowPointWithTextDisplay>TRUE</sml:AllowPointWithTextDisplay>\n" +
                "<sml:AllowThemeGraduatedSymbolOverlap>FALSE</sml:AllowThemeGraduatedSymbolOverlap>\n" +
                "<sml:AllowThemeGraphOverlap>FALSE</sml:AllowThemeGraphOverlap>\n" +
                "<sml:OverlappedSpaceX>0</sml:OverlappedSpaceX>\n" +
                "<sml:OverlappedSpaceY>0</sml:OverlappedSpaceY>\n" +
                "<sml:ObliqueRectEnabled>FALSE</sml:ObliqueRectEnabled>\n" +
                "<sml:AllowTextWithPointDisplay>TRUE</sml:AllowTextWithPointDisplay>\n" +
                "</sml:MapOverlapDisplayedOptions>\n" +
                "<sml:MapLabelAvoidWeightInfos/>\n" +
                "<sml:MapMaxScale>1000000000000.0000000000</sml:MapMaxScale>\n" +
                "<sml:MapMinScale>0.0000000000</sml:MapMinScale>\n" +
                "<sml:ProjectionOnTheFly>FALSE</sml:ProjectionOnTheFly>\n" +
                "<sml:DynamicTransMethod>9603</sml:DynamicTransMethod>\n" +
                "<sml:Parameters>\n" +
                "<sml:TranslateX>0.0000000000000000</sml:TranslateX>\n" +
                "<sml:TranslateY>0.0000000000000000</sml:TranslateY>\n" +
                "<sml:TranslateZ>0.0000000000000000</sml:TranslateZ>\n" +
                "<sml:RotateX>0.0000000000000000</sml:RotateX>\n" +
                "<sml:RotateY>0.0000000000000000</sml:RotateY>\n" +
                "<sml:RotateZ>0.0000000000000000</sml:RotateZ>\n" +
                "<sml:ScaleDifference>0.0000000000000000</sml:ScaleDifference>\n" +
                "<sml:RotationOriginX>0.0000000000000000</sml:RotationOriginX>\n" +
                "<sml:RotationOriginY>0.0000000000000000</sml:RotationOriginY>\n" +
                "<sml:RotationOriginZ>0.0000000000000000</sml:RotationOriginZ>\n" +
                "</sml:Parameters>\n" +
                "<sml:CoordinateReferenceSystem>\n" +
                "<sml:Name>GCS_WGS_1984</sml:Name>\n" +
                "<sml:Type>1</sml:Type>\n" +
                "<sml:EPSGCode>4326</sml:EPSGCode>\n" +
                "<sml:SRS/>\n" +
                "<sml:Units>METER</sml:Units>\n" +
                "<sml:DistUnits>METER</sml:DistUnits>\n" +
                "<sml:GeographicCoordinateSystem>\n" +
                "<sml:Name>GCS_WGS_1984</sml:Name>\n" +
                "<sml:Type>4326</sml:Type>\n" +
                "<sml:EPSGCode>4326</sml:EPSGCode>\n" +
                "<sml:Units>DEGREE</sml:Units>\n" +
                "<sml:DistUnits>METER</sml:DistUnits>\n" +
                "<sml:ProjectionHeight>0.0000000000</sml:ProjectionHeight>\n" +
                "<sml:HorizontalGeodeticDatum>\n" +
                "<sml:Name>D_WGS_1984</sml:Name>\n" +
                "<sml:Type>6326</sml:Type>\n" +
                "<sml:Spheroid>\n" +
                "<sml:Name>WGS_1984</sml:Name>\n" +
                "<sml:Type>7030</sml:Type>\n" +
                "<sml:SemiMajorAxis>6378137</sml:SemiMajorAxis>\n" +
                "<sml:InverseFlattening>298.257223563</sml:InverseFlattening>\n" +
                "</sml:Spheroid>\n" +
                "</sml:HorizontalGeodeticDatum>\n" +
                "<sml:PrimeMeridian>\n" +
                "<sml:Name>Greenwich</sml:Name>\n" +
                "<sml:Type>8901</sml:Type>\n" +
                "<sml:PrimeMeridian>0</sml:PrimeMeridian>\n" +
                "</sml:PrimeMeridian>\n" +
                "</sml:GeographicCoordinateSystem>\n" +
                "<sml:MapProjection>\n" +
                "<sml:Name/>\n" +
                "<sml:Type>43000</sml:Type>\n" +
                "</sml:MapProjection>\n" +
                "<sml:Parameters>\n" +
                "<sml:FalseEasting>0</sml:FalseEasting>\n" +
                "<sml:FalseNorthing>0</sml:FalseNorthing>\n" +
                "<sml:CentralMeridian>0</sml:CentralMeridian>\n" +
                "<sml:StandardParallel1>0</sml:StandardParallel1>\n" +
                "<sml:StandardParallel2>0</sml:StandardParallel2>\n" +
                "<sml:ScaleFactor>0</sml:ScaleFactor>\n" +
                "<sml:CentralParallel>0</sml:CentralParallel>\n" +
                "<sml:Azimuth>0</sml:Azimuth>\n" +
                "<sml:FirstPointLongitude>0</sml:FirstPointLongitude>\n" +
                "<sml:SecondPointLongitude>0</sml:SecondPointLongitude>\n" +
                "<sml:RectifiedAngle>0</sml:RectifiedAngle>\n" +
                "</sml:Parameters>\n" +
                "</sml:CoordinateReferenceSystem>\n" +
                "<sml:BackStyle>\n" +
                "<sml:MarkerStyle>0</sml:MarkerStyle>\n" +
                "<sml:MarkerSize>2.4</sml:MarkerSize>\n" +
                "<sml:MarkerAngle>0</sml:MarkerAngle>\n" +
                "<sml:MarkerWidth>24</sml:MarkerWidth>\n" +
                "<sml:MarkerHeight>24</sml:MarkerHeight>\n" +
                "<sml:MarkerPicturePath/>\n" +
                "<sml:MarkerSVGPath/>\n" +
                "<sml:FixedColorOfSVG>FALSE</sml:FixedColorOfSVG>\n" +
                "<sml:LineStyle>0</sml:LineStyle>\n" +
                "<sml:LineWidth>0.1</sml:LineWidth>\n" +
                "<sml:LineColor>RGB(0,0,130816)</sml:LineColor>\n" +
                "<sml:LineCapStyle>0</sml:LineCapStyle>\n" +
                "<sml:LineJoinStyle>0</sml:LineJoinStyle>\n" +
                "<sml:FillStyle>0</sml:FillStyle>\n" +
                "<sml:FillForeColor>RGB(255,255,131071)</sml:FillForeColor>\n" +
                "<sml:FillBackColor>RGB(255,255,131071)</sml:FillBackColor>\n" +
                "<sml:FillBackOpaque>TRUE</sml:FillBackOpaque>\n" +
                "<sml:GaussianBlur>FALSE</sml:GaussianBlur>\n" +
                "<sml:FillOpaqueRate>100</sml:FillOpaqueRate>\n" +
                "<sml:FillGradientType>None</sml:FillGradientType>\n" +
                "<sml:FillAngle>0</sml:FillAngle>\n" +
                "<sml:FillCenterOffsetX>0</sml:FillCenterOffsetX>\n" +
                "<sml:FillCenterOffsetY>0</sml:FillCenterOffsetY>\n" +
                "<sml:ShadowOffsetX>5</sml:ShadowOffsetX>\n" +
                "<sml:ShadowOffsetY>5</sml:ShadowOffsetY>\n" +
                "<sml:AcrossLongtitude>FALSE</sml:AcrossLongtitude>\n" +
                "</sml:BackStyle>\n" +
                "<sml:Time>\n" +
                "<sml:IsTimeEnable>FALSE</sml:IsTimeEnable>\n" +
                "<sml:TimeStep>0.0000000000</sml:TimeStep>\n" +
                "<sml:TimeWindow>0.0000000000</sml:TimeWindow>\n" +
                "<sml:StartTime>1899-12-30-00:00:00</sml:StartTime>\n" +
                "<sml:EndTime>1899-12-30-00:00:00</sml:EndTime>\n" +
                "<sml:CurrentTick>0</sml:CurrentTick>\n" +
                "<sml:TextStyle>\n" +
                "<sml:FaceName>Times New Roman</sml:FaceName>\n" +
                "<sml:Align>BottomRight</sml:Align>\n" +
                "<sml:StringAlign>StringTopLeft</sml:StringAlign>\n" +
                "<sml:ForeColor>RGB(0,0,130816)</sml:ForeColor>\n" +
                "<sml:BackColor>RGB(0,0,130816)</sml:BackColor>\n" +
                "<sml:BackOpaque>FALSE</sml:BackOpaque>\n" +
                "<sml:Height>6</sml:Height>\n" +
                "<sml:Width>0</sml:Width>\n" +
                "<sml:Weight>400</sml:Weight>\n" +
                "<sml:IsFixedSize>TRUE</sml:IsFixedSize>\n" +
                "<sml:FixedSize>0</sml:FixedSize>\n" +
                "<sml:Angle>0</sml:Angle>\n" +
                "<sml:Bold>FALSE</sml:Bold>\n" +
                "<sml:Italic>FALSE</sml:Italic>\n" +
                "<sml:ItalicAngle>0.00</sml:ItalicAngle>\n" +
                "<sml:StrikeOut>FALSE</sml:StrikeOut>\n" +
                "<sml:Underline>FALSE</sml:Underline>\n" +
                "<sml:Shadow>FALSE</sml:Shadow>\n" +
                "<sml:Halo>FALSE</sml:Halo>\n" +
                "<sml:Text3DOpaque>100</sml:Text3DOpaque>\n" +
                "<sml:Text3DScale>1.00</sml:Text3DScale>\n" +
                "<sml:HaloWidth>1</sml:HaloWidth>\n" +
                "<sml:BorderSpacingWidth>4</sml:BorderSpacingWidth>\n" +
                "<sml:ShadowOffsetX>1.000000</sml:ShadowOffsetX>\n" +
                "<sml:ShadowOffsetY>1.000000</sml:ShadowOffsetY>\n" +
                "<sml:ShadowColor>RGB(128,128,130944)</sml:ShadowColor>\n" +
                "<sml:FontInterval>0</sml:FontInterval>\n" +
                "<sml:DownAngle>0.000000</sml:DownAngle>\n" +
                "<sml:WordAngle>0.000000</sml:WordAngle>\n" +
                "<sml:BackBorderStyle>0</sml:BackBorderStyle>\n" +
                "<sml:BackLineWidth>1</sml:BackLineWidth>\n" +
                "<sml:Vertical>FALSE</sml:Vertical>\n" +
                "<sml:IgnoreSpacesBothEnds>TRUE</sml:IgnoreSpacesBothEnds>\n" +
                "<sml:LineSpacingType>1</sml:LineSpacingType>\n" +
                "<sml:LineSpacingParameter>1</sml:LineSpacingParameter>\n" +
                "</sml:TextStyle>\n" +
                "<sml:TimeTextPosition>8</sml:TimeTextPosition>\n" +
                "<sml:TimeFormat>YYYY-MM-DD hh:mm:ss</sml:TimeFormat>\n" +
                "<sml:IsShowTime>FALSE</sml:IsShowTime>\n" +
                "</sml:Time>\n" +
                "<sml:DisplayClip>FALSE</sml:DisplayClip>\n" +
                "<sml:CustomViewEntire>FALSE</sml:CustomViewEntire>\n" +
                "<sml:ZoomByScales>FALSE</sml:ZoomByScales>\n" +
                "<sml:ZoomScales/>\n" +
                "<sml:MaxVisibleVertex>36000000</sml:MaxVisibleVertex>\n" +
                "<sml:IsFillAngle>FALSE</sml:IsFillAngle>\n" +
                "<sml:IsSymbolFillIgnored>FALSE</sml:IsSymbolFillIgnored>\n" +
                "<sml:IsDisableDynamicEffect>FALSE</sml:IsDisableDynamicEffect>\n" +
                "<sml:IsDisableAuotAvoidEffect>FALSE</sml:IsDisableAuotAvoidEffect>\n" +
                "<sml:IsDrawBoundsLocked>FALSE</sml:IsDrawBoundsLocked>\n" +
                "<sml:PologonInterSect>TRUE</sml:PologonInterSect>\n" +
                "<sml:IsGraphicsAlphaEnabled>TRUE</sml:IsGraphicsAlphaEnabled>\n" +
                "<sml:IsTempCacheFileEnabled>FALSE</sml:IsTempCacheFileEnabled>\n" +
                "<sml:IsFullLabel>TRUE</sml:IsFullLabel>\n" +
                "<sml:ChartSetting>\n" +
                "<sml:ColorMode>DayBright</sml:ColorMode>\n" +
                "<sml:DisplayCategory>STANDARD</sml:DisplayCategory>\n" +
                "<sml:StyleRuleName>S52</sml:StyleRuleName>\n" +
                "<sml:SymbolizedBoundary>FALSE</sml:SymbolizedBoundary>\n" +
                "<sml:SimplifiedMarker>TRUE</sml:SimplifiedMarker>\n" +
                "<sml:MinVisibleScaleEnabled>TRUE</sml:MinVisibleScaleEnabled>\n" +
                "<sml:DisplaySounding>FALSE</sml:DisplaySounding>\n" +
                "<sml:DisplayText>FALSE</sml:DisplayText>\n" +
                "<sml:LocalizationDisplayText>FALSE</sml:LocalizationDisplayText>\n" +
                "<sml:FontName>Arial</sml:FontName>\n" +
                "<sml:FontSize>10.0</sml:FontSize>\n" +
                "<sml:DisplayMetaObject>FALSE</sml:DisplayMetaObject>\n" +
                "<sml:DisplaySafetyContourLabel>TRUE</sml:DisplaySafetyContourLabel>\n" +
                "<sml:DisplayOtherContourLabel>FALSE</sml:DisplayOtherContourLabel>\n" +
                "<sml:TwoShades>FALSE</sml:TwoShades>\n" +
                "<sml:SafetyContour>15.00</sml:SafetyContour>\n" +
                "<sml:ShallowContour>2.00</sml:ShallowContour>\n" +
                "<sml:DeepContour>20.00</sml:DeepContour>\n" +
                "<sml:SafetyDepth>30.00</sml:SafetyDepth>\n" +
                "<sml:DepthUnit>10000</sml:DepthUnit>\n" +
                "<sml:DisplayCellName>FALSE</sml:DisplayCellName>\n" +
                "<sml:LowAccurateEnable>TRUE</sml:LowAccurateEnable>\n" +
                "<sml:TextClipRegionEnabled>FALSE</sml:TextClipRegionEnabled>\n" +
                "<sml:DisplayScaleFactor>0.00000000000000000000e+00</sml:DisplayScaleFactor>\n" +
                "<sml:DisplayBorder>FALSE</sml:DisplayBorder>\n" +
                "<sml:Features/>\n" +
                "<sml:Style>\n" +
                "<sml:MarkerStyle>60000001</sml:MarkerStyle>\n" +
                "<sml:MarkerSize>0</sml:MarkerSize>\n" +
                "<sml:MarkerAngle>0</sml:MarkerAngle>\n" +
                "<sml:MarkerWidth>0</sml:MarkerWidth>\n" +
                "<sml:MarkerHeight>0</sml:MarkerHeight>\n" +
                "<sml:MarkerPicturePath/>\n" +
                "<sml:MarkerSVGPath/>\n" +
                "<sml:FixedColorOfSVG>FALSE</sml:FixedColorOfSVG>\n" +
                "<sml:LineStyle>0</sml:LineStyle>\n" +
                "<sml:LineWidth>0.6</sml:LineWidth>\n" +
                "<sml:LineColor>RGB(220,70,130856)</sml:LineColor>\n" +
                "<sml:LineCapStyle>0</sml:LineCapStyle>\n" +
                "<sml:LineJoinStyle>0</sml:LineJoinStyle>\n" +
                "<sml:FillStyle>2</sml:FillStyle>\n" +
                "<sml:FillForeColor>RGB(220,70,130856)</sml:FillForeColor>\n" +
                "<sml:FillBackColor>RGB(255,255,131071)</sml:FillBackColor>\n" +
                "<sml:FillBackOpaque>FALSE</sml:FillBackOpaque>\n" +
                "<sml:GaussianBlur>FALSE</sml:GaussianBlur>\n" +
                "<sml:FillOpaqueRate>100</sml:FillOpaqueRate>\n" +
                "<sml:FillGradientType>None</sml:FillGradientType>\n" +
                "<sml:FillAngle>0</sml:FillAngle>\n" +
                "<sml:FillCenterOffsetX>0</sml:FillCenterOffsetX>\n" +
                "<sml:FillCenterOffsetY>0</sml:FillCenterOffsetY>\n" +
                "<sml:ShadowOffsetX>5</sml:ShadowOffsetX>\n" +
                "<sml:ShadowOffsetY>5</sml:ShadowOffsetY>\n" +
                "<sml:AcrossLongtitude>FALSE</sml:AcrossLongtitude>\n" +
                "</sml:Style>\n" +
                "</sml:ChartSetting>\n" +
                "<sml:Layers>\n" +
                "<sml:MultiEditEnable>FALSE</sml:MultiEditEnable>\n" +
                "<sml:Layer>\n" +
                "<sml:Type>1</sml:Type>\n" +
                "<sml:LayerType>1</sml:LayerType>\n" +
                "<sml:LayerSubType>102</sml:LayerSubType>\n" +
                "<sml:DatasetType>5</sml:DatasetType>\n" +
                "<sml:Caption>test@test</sml:Caption>\n" +
                "<sml:Name>test@test</sml:Name>\n" +
                "<sml:Description/>\n" +
                "<sml:BlendMode>0</sml:BlendMode>\n" +
                "<sml:DataSourceAlias>test</sml:DataSourceAlias>\n" +
                "<sml:DatasetName>test</sml:DatasetName>\n" +
                "<sml:DisplayFilterStr/>\n" +
                "<sml:LayerWeight>0</sml:LayerWeight>\n" +
                "<sml:FillOrgMode>Absolute</sml:FillOrgMode>\n" +
                "<sml:Style>\n" +
                "<sml:MarkerStyle>0</sml:MarkerStyle>\n" +
                "<sml:MarkerSize>2.4</sml:MarkerSize>\n" +
                "<sml:MarkerAngle>0</sml:MarkerAngle>\n" +
                "<sml:MarkerWidth>24</sml:MarkerWidth>\n" +
                "<sml:MarkerHeight>24</sml:MarkerHeight>\n" +
                "<sml:MarkerPicturePath/>\n" +
                "<sml:MarkerSVGPath/>\n" +
                "<sml:FixedColorOfSVG>FALSE</sml:FixedColorOfSVG>\n" +
                "<sml:LineStyle>0</sml:LineStyle>\n" +
                "<sml:LineWidth>0.1</sml:LineWidth>\n" +
                "<sml:LineColor>RGB(102,102,130918)</sml:LineColor>\n" +
                "<sml:LineCapStyle>0</sml:LineCapStyle>\n" +
                "<sml:LineJoinStyle>0</sml:LineJoinStyle>\n" +
                "<sml:FillStyle>0</sml:FillStyle>\n" +
                "<sml:FillForeColor>RGB(174,241,130992)</sml:FillForeColor>\n" +
                "<sml:FillBackColor>RGB(255,255,131071)</sml:FillBackColor>\n" +
                "<sml:FillBackOpaque>TRUE</sml:FillBackOpaque>\n" +
                "<sml:GaussianBlur>FALSE</sml:GaussianBlur>\n" +
                "<sml:FillOpaqueRate>100</sml:FillOpaqueRate>\n" +
                "<sml:FillGradientType>None</sml:FillGradientType>\n" +
                "<sml:FillAngle>0</sml:FillAngle>\n" +
                "<sml:FillCenterOffsetX>0</sml:FillCenterOffsetX>\n" +
                "<sml:FillCenterOffsetY>0</sml:FillCenterOffsetY>\n" +
                "<sml:ShadowOffsetX>5</sml:ShadowOffsetX>\n" +
                "<sml:ShadowOffsetY>5</sml:ShadowOffsetY>\n" +
                "<sml:AcrossLongtitude>FALSE</sml:AcrossLongtitude>\n" +
                "</sml:Style>\n" +
                "<sml:RasterNewTag>FALSE</sml:RasterNewTag>\n" +
                "<sml:RasterOpaqueRate>100</sml:RasterOpaqueRate>\n" +
                "<sml:RasterBrightness>0</sml:RasterBrightness>\n" +
                "<sml:RasterContrast>0</sml:RasterContrast>\n" +
                "<sml:RasterTransColorTransparent>FALSE</sml:RasterTransColorTransparent>\n" +
                "<sml:ColorDictionaryAutoInterpolation>TRUE</sml:ColorDictionaryAutoInterpolation>\n" +
                "<sml:BackgroundTransparent>FALSE</sml:BackgroundTransparent>\n" +
                "<sml:RasterBkColor>RGB(255,255,131071)</sml:RasterBkColor>\n" +
                "<sml:RasterBKTolerance>0</sml:RasterBKTolerance>\n" +
                "<sml:GridNoData>nan</sml:GridNoData>\n" +
                "<sml:ImageNoData>nan</sml:ImageNoData>\n" +
                "<sml:ImageInterpolationMode>0</sml:ImageInterpolationMode>\n" +
                "<sml:GridNoDataColor>RGB(255,255,131071)</sml:GridNoDataColor>\n" +
                "<sml:BackgroundColor>RGB(255,255,131071)</sml:BackgroundColor>\n" +
                "<sml:ImageBackground>nan</sml:ImageBackground>\n" +
                "<sml:ImageBKgroundReplace>FALSE</sml:ImageBKgroundReplace>\n" +
                "<sml:ImageNoDataReplace>FALSE</sml:ImageNoDataReplace>\n" +
                "<sml:NoDataTransparent>FALSE</sml:NoDataTransparent>\n" +
                "<sml:ColorTable>\n" +
                "<sml:MaxZValue>0.00000000000000000000</sml:MaxZValue>\n" +
                "<sml:MinZValue>0.00000000000000000000</sml:MinZValue>\n" +
                "<sml:WaterLevel>0.00000000000000000000</sml:WaterLevel>\n" +
                "<sml:bUsingWaterLevel>FALSE</sml:bUsingWaterLevel>\n" +
                "<sml:bUsingColorDictTable>FALSE</sml:bUsingColorDictTable>\n" +
                "</sml:ColorTable>\n" +
                "<sml:QueryDef>\n" +
                "<sml:QueryType>General</sml:QueryType>\n" +
                "<sml:Options>\n" +
                "<sml:Geometry>TRUE</sml:Geometry>\n" +
                "<sml:Attribute>TRUE</sml:Attribute>\n" +
                "</sml:Options>\n" +
                "<sml:Mode>GeneralQuery</sml:Mode>\n" +
                "<sml:CursorType>OpenDynamic</sml:CursorType>\n" +
                "<sml:CursorLocation>UserServer</sml:CursorLocation>\n" +
                "</sml:QueryDef>\n" +
                "<sml:VisibleSettings>\n" +
                "<sml:VisibleObjectMinimum>0.1</sml:VisibleObjectMinimum>\n" +
                "<sml:MinVisibleScale>0.00000000000000000000e+00</sml:MinVisibleScale>\n" +
                "<sml:MaxVisibleScale>0.00000000000000000000e+00</sml:MaxVisibleScale>\n" +
                "</sml:VisibleSettings>\n" +
                "<sml:Options>\n" +
                "<sml:Visible>TRUE</sml:Visible>\n" +
                "<sml:Selectable>TRUE</sml:Selectable>\n" +
                "<sml:Editable>FALSE</sml:Editable>\n" +
                "<sml:EditableLock>FALSE</sml:EditableLock>\n" +
                "<sml:Snapable>TRUE</sml:Snapable>\n" +
                "<sml:SymbolScalable>FALSE</sml:SymbolScalable>\n" +
                "<sml:LineAdjust>FALSE</sml:LineAdjust>\n" +
                "<sml:IsAntialias>TRUE</sml:IsAntialias>\n" +
                "<sml:AllowTextOverlap>FALSE</sml:AllowTextOverlap>\n" +
                "<sml:IsAllowTextOverlap>TRUE</sml:IsAllowTextOverlap>\n" +
                "<sml:IsSuperAndSubScript>TRUE</sml:IsSuperAndSubScript>\n" +
                "<sml:CrossroadOptimized>FALSE</sml:CrossroadOptimized>\n" +
                "</sml:Options>\n" +
                "<sml:SymbolScaleDefinition>0</sml:SymbolScaleDefinition>\n" +
                "<sml:PologonInterSect>TRUE</sml:PologonInterSect>\n" +
                "<sml:DisplayClip>TRUE</sml:DisplayClip>\n" +
                "<sml:TransPercent>0</sml:TransPercent>\n" +
                "<sml:IsUseRepresentation>FALSE</sml:IsUseRepresentation>\n" +
                "<sml:RepresentationFieldName/>\n" +
                "<sml:RefRepreFieldName/>\n" +
                "<sml:ThemeRepreFieldName/>\n" +
                "<sml:ImageDisplayMode>0</sml:ImageDisplayMode>\n" +
                "<sml:EnableTimeFilter>FALSE</sml:EnableTimeFilter>\n" +
                "<sml:StartTimeField/>\n" +
                "<sml:EndTimeField/>\n" +
                "<sml:StartFilterTime>1899-12-30-00:00:00</sml:StartFilterTime>\n" +
                "<sml:EndFilterTime>1899-12-30-00:00:00</sml:EndFilterTime>\n" +
                "<sml:TimeStep>0.0000000000</sml:TimeStep>\n" +
                "<sml:WebSubLayers/>\n" +
                "<sml:ExternalInfo/>\n" +
                "<sml:Selection>\n" +
                "<sml:UseCustomStyle>FALSE</sml:UseCustomStyle>\n" +
                "<sml:StyleOptions>69631</sml:StyleOptions>\n" +
                "<sml:Style>\n" +
                "<sml:MarkerStyle>0</sml:MarkerStyle>\n" +
                "<sml:MarkerSize>2.4</sml:MarkerSize>\n" +
                "<sml:MarkerAngle>0</sml:MarkerAngle>\n" +
                "<sml:MarkerWidth>24</sml:MarkerWidth>\n" +
                "<sml:MarkerHeight>24</sml:MarkerHeight>\n" +
                "<sml:MarkerPicturePath/>\n" +
                "<sml:MarkerSVGPath/>\n" +
                "<sml:FixedColorOfSVG>FALSE</sml:FixedColorOfSVG>\n" +
                "<sml:LineStyle>0</sml:LineStyle>\n" +
                "<sml:LineWidth>0.1</sml:LineWidth>\n" +
                "<sml:LineColor>RGB(0,0,131071)</sml:LineColor>\n" +
                "<sml:LineCapStyle>0</sml:LineCapStyle>\n" +
                "<sml:LineJoinStyle>0</sml:LineJoinStyle>\n" +
                "<sml:FillStyle>1</sml:FillStyle>\n" +
                "<sml:FillForeColor>RGB(189,235,131071)</sml:FillForeColor>\n" +
                "<sml:FillBackColor>RGB(255,255,131071)</sml:FillBackColor>\n" +
                "<sml:FillBackOpaque>TRUE</sml:FillBackOpaque>\n" +
                "<sml:GaussianBlur>FALSE</sml:GaussianBlur>\n" +
                "<sml:FillOpaqueRate>100</sml:FillOpaqueRate>\n" +
                "<sml:FillGradientType>None</sml:FillGradientType>\n" +
                "<sml:FillAngle>0</sml:FillAngle>\n" +
                "<sml:FillCenterOffsetX>0</sml:FillCenterOffsetX>\n" +
                "<sml:FillCenterOffsetY>0</sml:FillCenterOffsetY>\n" +
                "<sml:ShadowOffsetX>5</sml:ShadowOffsetX>\n" +
                "<sml:ShadowOffsetY>5</sml:ShadowOffsetY>\n" +
                "<sml:AcrossLongtitude>FALSE</sml:AcrossLongtitude>\n" +
                "</sml:Style>\n" +
                "</sml:Selection>\n" +
                "<sml:LayerExtensionType>0</sml:LayerExtensionType>\n" +
                "<sml:LayerExtensionBounds>\n" +
                "<sml:Left>0.0000000000</sml:Left>\n" +
                "<sml:Top>0.0000000000</sml:Top>\n" +
                "<sml:Right>0.0000000000</sml:Right>\n" +
                "<sml:Bottom>0.0000000000</sml:Bottom>\n" +
                "</sml:LayerExtensionBounds>\n" +
                "<sml:LayerExtensionBaseUserXml/>\n" +
                "<sml:LayerExtensionBaseUserInfo/>\n" +
                "<sml:LayerGridFunctionSetting/>\n" +
                "<sml:DeduplicateEnabled>TRUE</sml:DeduplicateEnabled>\n" +
                "<sml:DeduplicateTolerance>0.50</sml:DeduplicateTolerance>\n" +
                "<sml:DeduplicateThreshold>50</sml:DeduplicateThreshold>\n" +
                "<sml:OverlapGeometryEnabled>FALSE</sml:OverlapGeometryEnabled>\n" +
                "<sml:OverlapGeometryThreshold>1.0</sml:OverlapGeometryThreshold>\n" +
                "<sml:OverlapGeometryPixel>1</sml:OverlapGeometryPixel>\n" +
                "<sml:ExtensionPluginName/>\n" +
                "<sml:FullLabelEnabled>TRUE</sml:FullLabelEnabled>\n" +
                "</sml:Layer>\n" +
                "</sml:Layers>\n" +
                "<sml:BGGridSetting>\n" +
                "<sml:BGGridShow>FALSE</sml:BGGridShow>\n" +
                "<sml:BGGridDP>FALSE</sml:BGGridDP>\n" +
                "<sml:BGGridType>2</sml:BGGridType>\n" +
                "<sml:BGGridMax>100</sml:BGGridMax>\n" +
                "<sml:BGRcMargin>\n" +
                "<sml:Left>0</sml:Left>\n" +
                "<sml:Top>0</sml:Top>\n" +
                "<sml:Right>0</sml:Right>\n" +
                "<sml:Bottom>0</sml:Bottom>\n" +
                "</sml:BGRcMargin>\n" +
                "<sml:BGGridSize>\n" +
                "<SIZEX>0</SIZEX>\n" +
                "<SIZEY>0</SIZEY>\n" +
                "</sml:BGGridSize>\n" +
                "<sml:BGGridStyle>&lt;sml:Style&gt;\n" +
                "&lt;sml:MarkerStyle&gt;0&lt;/sml:MarkerStyle&gt;\n" +
                "&lt;sml:MarkerSize&gt;2.4&lt;/sml:MarkerSize&gt;\n" +
                "&lt;sml:MarkerAngle&gt;0&lt;/sml:MarkerAngle&gt;\n" +
                "&lt;sml:MarkerWidth&gt;24&lt;/sml:MarkerWidth&gt;\n" +
                "&lt;sml:MarkerHeight&gt;24&lt;/sml:MarkerHeight&gt;\n" +
                "&lt;sml:MarkerPicturePath/&gt;\n" +
                "&lt;sml:MarkerSVGPath/&gt;\n" +
                "&lt;sml:FixedColorOfSVG&gt;FALSE&lt;/sml:FixedColorOfSVG&gt;\n" +
                "&lt;sml:LineStyle&gt;0&lt;/sml:LineStyle&gt;\n" +
                "&lt;sml:LineWidth&gt;0.1&lt;/sml:LineWidth&gt;\n" +
                "&lt;sml:LineColor&gt;RGB(0,0,130816)&lt;/sml:LineColor&gt;\n" +
                "&lt;sml:LineCapStyle&gt;0&lt;/sml:LineCapStyle&gt;\n" +
                "&lt;sml:LineJoinStyle&gt;0&lt;/sml:LineJoinStyle&gt;\n" +
                "&lt;sml:FillStyle&gt;0&lt;/sml:FillStyle&gt;\n" +
                "&lt;sml:FillForeColor&gt;RGB(189,235,131071)&lt;/sml:FillForeColor&gt;\n" +
                "&lt;sml:FillBackColor&gt;RGB(255,255,131071)&lt;/sml:FillBackColor&gt;\n" +
                "&lt;sml:FillBackOpaque&gt;TRUE&lt;/sml:FillBackOpaque&gt;\n" +
                "&lt;sml:GaussianBlur&gt;FALSE&lt;/sml:GaussianBlur&gt;\n" +
                "&lt;sml:FillOpaqueRate&gt;100&lt;/sml:FillOpaqueRate&gt;\n" +
                "&lt;sml:FillGradientType&gt;None&lt;/sml:FillGradientType&gt;\n" +
                "&lt;sml:FillAngle&gt;0&lt;/sml:FillAngle&gt;\n" +
                "&lt;sml:FillCenterOffsetX&gt;0&lt;/sml:FillCenterOffsetX&gt;\n" +
                "&lt;sml:FillCenterOffsetY&gt;0&lt;/sml:FillCenterOffsetY&gt;\n" +
                "&lt;sml:ShadowOffsetX&gt;5&lt;/sml:ShadowOffsetX&gt;\n" +
                "&lt;sml:ShadowOffsetY&gt;5&lt;/sml:ShadowOffsetY&gt;\n" +
                "&lt;sml:AcrossLongtitude&gt;FALSE&lt;/sml:AcrossLongtitude&gt;\n" +
                "&lt;/sml:Style&gt;\n" +
                "</sml:BGGridStyle>\n" +
                "<sml:BGGridSpaceStyle>&lt;sml:Style&gt;\n" +
                "&lt;sml:MarkerStyle&gt;0&lt;/sml:MarkerStyle&gt;\n" +
                "&lt;sml:MarkerSize&gt;2.4&lt;/sml:MarkerSize&gt;\n" +
                "&lt;sml:MarkerAngle&gt;0&lt;/sml:MarkerAngle&gt;\n" +
                "&lt;sml:MarkerWidth&gt;24&lt;/sml:MarkerWidth&gt;\n" +
                "&lt;sml:MarkerHeight&gt;24&lt;/sml:MarkerHeight&gt;\n" +
                "&lt;sml:MarkerPicturePath/&gt;\n" +
                "&lt;sml:MarkerSVGPath/&gt;\n" +
                "&lt;sml:FixedColorOfSVG&gt;FALSE&lt;/sml:FixedColorOfSVG&gt;\n" +
                "&lt;sml:LineStyle&gt;2&lt;/sml:LineStyle&gt;\n" +
                "&lt;sml:LineWidth&gt;0.1&lt;/sml:LineWidth&gt;\n" +
                "&lt;sml:LineColor&gt;RGB(0,0,130816)&lt;/sml:LineColor&gt;\n" +
                "&lt;sml:LineCapStyle&gt;0&lt;/sml:LineCapStyle&gt;\n" +
                "&lt;sml:LineJoinStyle&gt;0&lt;/sml:LineJoinStyle&gt;\n" +
                "&lt;sml:FillStyle&gt;0&lt;/sml:FillStyle&gt;\n" +
                "&lt;sml:FillForeColor&gt;RGB(189,235,131071)&lt;/sml:FillForeColor&gt;\n" +
                "&lt;sml:FillBackColor&gt;RGB(255,255,131071)&lt;/sml:FillBackColor&gt;\n" +
                "&lt;sml:FillBackOpaque&gt;TRUE&lt;/sml:FillBackOpaque&gt;\n" +
                "&lt;sml:GaussianBlur&gt;FALSE&lt;/sml:GaussianBlur&gt;\n" +
                "&lt;sml:FillOpaqueRate&gt;100&lt;/sml:FillOpaqueRate&gt;\n" +
                "&lt;sml:FillGradientType&gt;None&lt;/sml:FillGradientType&gt;\n" +
                "&lt;sml:FillAngle&gt;0&lt;/sml:FillAngle&gt;\n" +
                "&lt;sml:FillCenterOffsetX&gt;0&lt;/sml:FillCenterOffsetX&gt;\n" +
                "&lt;sml:FillCenterOffsetY&gt;0&lt;/sml:FillCenterOffsetY&gt;\n" +
                "&lt;sml:ShadowOffsetX&gt;5&lt;/sml:ShadowOffsetX&gt;\n" +
                "&lt;sml:ShadowOffsetY&gt;5&lt;/sml:ShadowOffsetY&gt;\n" +
                "&lt;sml:AcrossLongtitude&gt;FALSE&lt;/sml:AcrossLongtitude&gt;\n" +
                "&lt;/sml:Style&gt;\n" +
                "</sml:BGGridSpaceStyle>\n" +
                "</sml:BGGridSetting>\n" +
                "<sml:UseMapSources>FALSE</sml:UseMapSources>\n" +
                "<sml:MapBookMarks/>\n" +
                "<sml:StreamLayers/>\n" +
                "<sml:ExternalXML/>\n" +
                "</sml:Map>\n";

        int count = datasource.getDatasets().getCount();

        for(int i=0;i<count;i++){
            Dataset dataset = datasource.getDatasets().get(0);
            Workspace newWorkspace = new Workspace();
            WorkspaceConnectionInfo workspaceConnectionInfo = new WorkspaceConnectionInfo();
            workspaceConnectionInfo.setType(WorkspaceType.SMWU);
            String file = "E:\\MapData\\202405\\桌面高级\\GDB数据\\swmus\\world"+i+".smwu";
            workspaceConnectionInfo.setServer(file);
            newWorkspace.create(workspaceConnectionInfo);
            DatasourceConnectionInfo info = new DatasourceConnectionInfo();
            info.setEngineType(EngineType.UDBX);
            info.setServer("E:\\MapData\\202405\\桌面高级\\GDB数据\\swmus\\world"+i+".udbx");
            info.setAlias("test");
            Datasource ds = newWorkspace.getDatasources().create(info);
            ds.copyDataset(dataset,"test",EncodeType.NONE);
            newWorkspace.getMaps().add("test",mapXml);
            newWorkspace.save();
            newWorkspace.dispose();



            String smwuProviderName = "ugcMapProvider-test";
            postSmwuProvider(smwuProviderName+i, "E:\\MapData\\202405\\桌面高级\\GDB数据\\swmus\\world"+i+".smwu");
            postComponent("testmap"+i, smwuProviderName+i, "rest");
        }










    }

    public static void postSmwuProvider(String smwuProviderName, String workSpacePath) {
  //      try {

//            String urlString = genPath+"/iserver/manager/providers.rjson";
//
//            workSpacePath = workSpacePath.replaceAll("\\\\", "/");
//
//            String requestBody = "{\"name\":\"" + smwuProviderName + "\", \"type\":\"com.supermap.services.providers.UGCMapProvider\", \"enabled\":true, \"config\":{\"workspacePath\":\"" + workSpacePath + "\", \"mapEditable\":false, \"cacheVersion\":\"5.0\", \"preferedPNGType\":\"PNG\", \"ugcMapSettings\":[], \"multiThread\":true, \"cacheDisabled\":false, \"poolSize\":\"0\"}}";
//
//            OkHttpClient client = new OkHttpClient().newBuilder()
//                    .build();
//            MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded; charset=UTF-8");
//            RequestBody body = RequestBody.create(mediaType, requestBody);
//            Request request = new Request.Builder()
//                    .url(urlString)
//                    .method("POST", body)
//                    .addHeader("Content-Type", "application/json")
//                    .addHeader("Authorization", "Bearer pNNnhJhn89ChGHJG5gQdbenYW55Q1drOapZ7UAoMR8uQkHpvo2mzC_UbC2qwMYbGXnTM29c5qPMKMO2_yOeBmrNK")
//                    .build();
//            Response response = client.newCall(request).execute();
//            ResponseBody responseBody = response.body();
//            if (responseBody != null) {
//                String result = responseBody.string();
//                System.out.println("Response Result:");
//                System.out.println(result);
//            }
//            System.out.println("smwu服务提供者发布完成");
//        } catch (Exception e) {
//            e.printStackTrace();
//        }

    }


    public static void postComponent(String mapName, String providers, String serviceType) {
//        try {
//
//            String urlString = genPath + "/iserver/manager/components.rjson";
//
//            String requestBody = "{\"name\":\"" + mapName + "\", \"alias\":\"\", \"type\":\"com.supermap.services.components.impl.MapImpl\"," +
//                    " \"providers\":\"" + providers + "\", \"interfaceNames\":\""+serviceType+"\", " +
//                    "\"config\":{\"tileCacheConfig\":{\"outputPath\":\"D:/supermap/iServer/supermap-iserver-1021-22801-6464-windows-x64-deploy-usv3383/supermap-iserver-1021-22801-6464-windows-x64-deploy/webapps/iserver/output/sqlite\", " +
//                    "\"type\":\"SMTiles\"}, \"useCache\":false, \"useVectorTileCache\":false, \"useUTFGridCache\":false," +
//                    " \"cacheReadOnly\":false, \"utfGridCacheConfig\":{\"outputPath\":\"D:/supermap/iServer/supermap-iserver-1021-22801-6464-windows-x64-deploy-usv3383/supermap-iserver-1021-22801-6464-windows-x64-deploy/webapps/iserver/output/sqlite\", " +
//                    "\"type\":\"UTFGrid\"}, \"vectorTileCacheConfig\":{\"outputPath\":null, \"type\":\"SVTiles\"}, \"expired\":0}}: "; // 设置请求体数据
//
//            OkHttpClient client = new OkHttpClient().newBuilder()
//                    .build();
//            MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded; charset=UTF-8");
//            RequestBody body = RequestBody.create(mediaType, requestBody);
//            Request request = new Request.Builder()
//                    .url(urlString)
//                    .method("POST", body)
//                    .addHeader("Accept", "*/*")
//                    .addHeader("Accept-Language", "zh-CN,zh;q=0.9")
//                    .addHeader("Cache-Control", "no-cache")
//                    .addHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8")
//                    .addHeader("Authorization", "Bearer pNNnhJhn89ChGHJG5gQdbenYW55Q1drOapZ7UAoMR8uQkHpvo2mzC_UbC2qwMYbGXnTM29c5qPMKMO2_yOeBmrNK")
//                    .build();
//            Response response = client.newCall(request).execute();
//            ResponseBody responseBody = response.body();
//            if (responseBody != null) {
//                String result = responseBody.string();
//                System.out.println("Response Result:");
//                System.out.println(result);
//            }
//
//            System.out.println("服务组件发布完成");
//
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
    }


    


}  

